$j(document).ready(function(){
});

 
//验证函数
function validateAction(){
	if(!validateForm($j('#attributeDiv').get(0))){
		//alert(__vaMsg.notPass);
    	return false;
   	}
   	return true;
}
//保存属性
function saveAttribute(){
	if(validateAction()){
		var postData = $j('#attributeDiv :input').serializeArray();
		var url=__ctxPath+"/attribute/attributeDefiner/dialog.html?doAction=save";
		$j.post(url,postData,saveAttributeCallback,"json");
	}else{
		jAlert(__vaMsg.notPass);
	}   
}

//保存属性后的callback函数
function saveAttributeCallback(attribute){
	$("attributeId").value = attribute.attributeId;
	$j("input[name='attributeDataType']").each(function(i){
		$j(this).attr('disabled','true');
	});	
	callbackFunc.call(this,attribute);
}
//改变属性类型，刷新缺省值区域
function changeDataType(radioDOM){
	$j('#defaultValueSpan').loading().load(__ctxPath+'/attribute/attributeDefiner/blank.html?doAction=refreshDefaultValue&dataType='+radioDOM.value);
}

